<?php



$a = ['a','b','c||d','e||f||g','h'];
print_r(geta($a));exit;
function geta($a)
{
    $result = [];
    $index = 0;
    foreach ($a as $key => $val) {
        $val = explode("||", $val);
        foreach ($val as $valIndex=>$realVal) {
            if ($valIndex == 0) {
                for ($i=0;$i<=$index;$i++) {
                    $result[$i][$key] = $val[0];
                }
            } else {
                $index = $index+1;
                $result[$index] = $result[$index-1];

                for ($i=0;$i<=$index;$i++) {
                    $result[$i][$key] = $val[0];
                }

            }


        }


        if (count($val) > 1) {

            for ($i=1;$i<count($val);$i++) {
                $index = $index+1;
                $result[$i] = $result[$i-1];
                for ($j=0;$j<=$index;$j++) {
                    $result[$j][$key] = $val[0];
                }
            }
        } else {
            for ($i=0;$i<=$index;$i++) {
                $result[$i][$key] = $val[0];
            }
        }

    }

    return $b;

}

print_r(array_diff($b,$a));exit;


empty($a) && $a=[0];
print_r($a);exit;
$string = '为什么订单';
$regex = "/[\\+\\-\\=\\&\\|\\!\\(\\)\\{\\}\\[\\]\\^\\\"\\~\\*\\<\\>\\?\\:\\\\\\/]/";
$a= preg_replace($regex, addslashes('\\$0'), $string);
print_r($a);exit;

$time = time();
$data["text"]="你好呀";
$data['timestamp']=$time;
$data['app_id']='test';
$data['app_secret']="321pg";
foreach ($data as $key => $val) {
    if (is_array($val)) {
        $data[$key] = json_encode($val, JSON_UNESCAPED_UNICODE);
    }
}
ksort($data);
$string = '';
foreach ($data as $key => $val) {
    $string .= $key . '=' . $val . '&';
}
$string = rtrim($string, '&');

$originSign = md5($string);
echo $string ."\n" . $originSign;